#include"test.h"

void Bar(double total,double Downloaded)
{
  char symbol[]="-/|\\";
  char str[101]={0};
  int cnt=0,len=strlen(symbol);

  double schedule=1.0*100*Downloaded/total;
  if(schedule>100) schedule=100;
  int num=(int)schedule;
  while(cnt<=num)
  {
    str[cnt++]='#';
  }
    printf("[%-101s][%6.2f%%][%c]\r",str,schedule,symbol[num%len]);
    fflush(stdout);
}

